/**
 * 作用与RQMCRT中的SolarScene一样，用来保存场景中的网格、定日镜、接收器、光线等
 *
 * 但是获取数据的方式不一样，这里是从Scene的paracontroller中获取的，
 */

#ifndef SCENEFIELD_H
#define SCENEFIELD_H

#include <cstdlib>
#include <vector>

#include <memory>

// #include "Scene.h"

namespace solar
{
    namespace cuda
    {
        class CudaGrid;
        class CudaHeliostat;
        class CudaReceiver;
        class CudaSunray;
    } // namespace cuda

    class SceneField
    {
        public:
            // 补充：：构造函数
            void setGroundLength(float ground_length);
            [[nodiscard]] auto getGroundLength() const -> float;
            void setGroundWidth(float ground_width);
            [[nodiscard]] auto getGroundWidth() const -> float;
            auto getSunRay() -> std::shared_ptr<cuda::CudaSunray>;
            auto getGrids() -> std::vector<std::shared_ptr<cuda::CudaGrid>>&;
            auto getHeliostats() -> std::vector<std::shared_ptr<cuda::CudaHeliostat>>&;
            auto getReceivers() -> std::vector<std::shared_ptr<cuda::CudaReceiver>>&;

            void setSunRay(std::shared_ptr<cuda::CudaSunray> sunray);
            void addGrid(std::shared_ptr<cuda::CudaGrid> grid);
            void addHeliostat(std::shared_ptr<cuda::CudaHeliostat> helio);
            void addReceiver(std::shared_ptr<cuda::CudaReceiver> rev);

            void test();

        private:
            float ground_length_;
            float ground_width_;

            std::shared_ptr<cuda::CudaSunray> sunray_; // 记录光线的信息
            // 整个场景的网格信息?????网格怎么划分？？？
            std::vector<std::shared_ptr<cuda::CudaGrid>> grids_;
            std::vector<std::shared_ptr<cuda::CudaHeliostat>> heliostats_; // 整个场景的定日镜
            std::vector<std::shared_ptr<cuda::CudaReceiver>> receivers_;   // 整个场景中的接收器
    };
} // namespace solar

#endif
